<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title>My JSP 'testUser.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<%=path%>/js/jquery.min.js"></script>
  </head>
  
  <body>
  <input type="button" class="but" value="登录相关" onclick="divctrl('user')"/>
  <input type="button" class="but" value="首页相关" onclick="divctrl('index')"/>
  <input type="button" class="but" value="购物车相关" onclick="divctrl('userCar')"/>
  <input type="button" class="but" value="用户中心相关" onclick="divctrl('userCenter')"/>
  <div id="user"  >
  <div style="width: 50%;margin-left: 45%;margin-top: 20x;">登录相关</div>
  <input style="width: 100%" type="button" class="but" value="发短信" onclick="sendMSG()" /><br>
  <input style="width: 100%" type="button" class="but" value="用户注册" onclick="userReg()" /><br>
  <input style="width: 100%" type="button" class="but" value="用户登录" onclick="login()" /><br>
  <input style="width: 100%" type="button" class="but" value="获取用户信息" onclick="getUserInfo()" /><br>
  </div>
  <div id="index" style="display: none" >
  <div style="width: 50%;margin-left: 45%;margin-top: 20x;">首页相关</div>
  <input style="width: 100%" type="button" class="but" value="查询轮播广告" onclick="getBanner()" /><br>
  <input style="width: 100%" type="button" class="but" value="首页推荐商品" onclick="recommendGoods()" /><br>
  <input style="width: 100%" type="button" class="but" value="首页信息" onclick="getIndexNotice()" /><br>
  <input style="width: 100%" type="button" class="but" value="查看全部商品分类" onclick="getGoodsClasses()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询商品列表" onclick="getGoodsList()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询商品详情" onclick="getGoodsDetail()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询所有省" onclick="getCity1()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询市" onclick="getCity2()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询区" onclick="getCity3()" /><br>
  </div>
  
  <div id="userCar" style="display: none" >
  <div style="width: 50%;margin-left: 45%;margin-top: 20x;">购物车相关</div>
  <input style="width: 100%" type="button" class="but" value="查询购物车" onclick="getMyCar()" /><br>
  <input style="width: 100%" type="button" class="but" value="新增商品到购物车" onclick="addCar()" /><br>
  <input style="width: 100%" type="button" class="but" value="修改商品数量" onclick="upCar()" /><br>
  <input style="width: 100%" type="button" class="but" value="删除商品" onclick="delCar()" /><br>
  <input style="width: 100%" type="button" class="but" value="查看商品邮费" onclick="getPostFee()" /><br>
  <input style="width: 100%" type="button" class="but" value="直接购买商品" onclick="buyGoods()" /><br>
  <input style="width: 100%" type="button" class="but" value="购买购物车商品" onclick="buyCarGoods()" /><br>
  <input style="width: 100%" type="button" class="but" value="测试购买成功" onclick="testPayBack()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询支付信息" onclick="getPayMsg()" /><br>
  
  </div>
  <div id="userCenter" style="display: none" >
  <div style="width: 50%;margin-left: 45%;margin-top: 20x;">用户众心</div>
  <input style="width: 100%" type="button" class="but" value="查询我的地址" onclick="myAddr()" /><br>
  <input style="width: 100%" type="button" class="but" value="新增地址" onclick="addAddr()" /><br>
  <input style="width: 100%" type="button" class="but" value="编辑地址" onclick="editAddr()" /><br>
  <input style="width: 100%" type="button" class="but" value="删除地址" onclick="delAddr()" /><br>
  <input style="width: 100%" type="button" class="but" value="设置默认地址" onclick="setDefaultAddr()" /><br>
  <input style="width: 100%" type="button" class="but" value="获取默认地址" onclick="getDefaultAddr()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询订单" onclick="myList()" /><br>
  <input style="width: 100%" type="button" class="but" value="订单详情" onclick="myListDetail()" /><br>
  <input style="width: 100%" type="button" class="but" value="取消订单" onclick="cancelList()" /><br>
  <input style="width: 100%" type="button" class="but" value="我的会员" onclick="myMember()" /><br>
  <input style="width: 100%" type="button" class="but" value="交易记录" onclick="amountLog()" /><br>
  <input style="width: 100%" type="button" class="but" value="我的二维码" onclick="myCodePage()" /><br>
  <input style="width: 100%" type="button" class="but" value="转账" onclick="transferAmount()" /><br>
  <input style="width: 100%" type="button" class="but" value="提现" onclick="cashOut()" /><br>
  <input style="width: 100%" type="button" class="but" value="线下支付" onclick="payOffLine()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询转账对象" onclick="getUserByCP()" /><br>
  <input style="width: 100%" type="button" class="but" value="修改密码" onclick="changePWD()" /><br>
  <input style="width: 100%" type="button" class="but" value="编辑用户" onclick="editUser()" /><br>
  <input style="width: 100%" type="button" class="but" value="上月绩效" onclick="testMonthAmount()" /><br>
  <input style="width: 100%" type="button" class="but" value="申请区域代理" onclick="applyArea()" /><br>
  <input style="width: 100%" type="button" class="but" value="查询区域代理" onclick="selArea()" /><br>
  <input style="width: 100%" type="button" class="but" value="申请成为店" onclick="shopRequest()" /><br>
  
  
  </div>
  <div id="userCenter" style="display: none" >
  <div style="width: 50%;margin-left: 45%;margin-top: 20x;">个人中心</div>
  
  </div>
  <div id="res"></div>
  
  
  <script type="text/javascript">
  function divctrl(id){
	  $("#"+id).toggle();
  }
  </script>
  <script type="text/javascript">
  var phone="13349307202";
  //var phone="13109405596";//兰州

  //var phone="13796012365";//普通用户
  
  var datakey="7788945";
  var userid="";
  var smsCode="163361";
  var UUID="123123";
  var openid="1";
  var listid="20220425123712675642";
  var city="哈尔滨";
  function login(){
	  $.post("<%=path%>/appUser/user/login",{"phone":phone,"code":smsCode,"type":"1","UUID":UUID},function(data){
		  
		  var obj=JSON.parse(data);
		  console.log(obj);
		  if(obj.code=="00"){
			  userid=obj.data.id;
		  }
		  console.log(data);
		  $("#res").html(data);
	  })
  }
  function userReg(){
	  $.post("<%=path%>/appUser/user/userReg",{"phone":phone,"code":smsCode,"tjcode":"99999999"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  function sendMSG(){
	  $.post("<%=path%>/appUser/user/sendMSG",{"phone":phone},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getUserInfo(){
	  $.post("<%=path%>/appUser/user/getUserInfo",{"userid":userid,"datakey":datakey,"UUID":UUID},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getSysConfig(){
	  $.post("<%=path%>/miniuser/user/getSysConfig",{"userid":userid},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  function getPhoneNumber(){
	  $.post("<%=path%>/miniuser/user/getPhoneNumber",{"encryptedData":"7if7Xjnkly6XM8sbg4radayN8seGU044Q6wIGKsl1z2MctX5p2cO1oDpOqtXhfSYoU8htxpDXXBS6jW6BICy/RhFkswXDBloFqBHzE0DdMya5zpzh6cSraQjzVAKIOR40m3ZbnVcNPoC9PX84Y1ZdAh2qNH1aH0bqgwaeoEvEDBXpU/H7cqX4C7S+UHjQrhn6aZjG93aC1tE0uWaUzZLRA==","iv":"uUSwCDRWu8+N6NNOdyJgRg==","openid":"o4bMG5VH1u1H8kXoSE4bwWwwxegQ","session_key":"7NWnaI9OqphAzgI2GSHhUw=="},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  function getBanner(){
	  $.post("<%=path%>/appUser/shopOpen/getBanner",{},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  
  function recommendGoods(){
	  $.post("<%=path%>/appUser/shopOpen/recommendGoods",{},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  function getIndexNotice(){
	  $.post("<%=path%>/appUser/shopOpen/getIndexNotice",{},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getGoodsClasses(){
	  $.post("<%=path%>/appUser/shopOpen/getGoodsClasses",{},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getGoodsList(){
	  $.post("<%=path%>/appUser/shopOpen/getGoodsList",{},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getGoodsDetail(){
	  $.post("<%=path%>/appUser/shopOpen/getGoodsDetail",{"id":"1"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getCity1(){
	  $.post("<%=path%>/appUser/shopOpen/getCity",{"type":"1"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getCity2(){
	  $.post("<%=path%>/appUser/shopOpen/getCity",{"id":"130000","type":"2"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getCity3(){
	  $.post("<%=path%>/appUser/shopOpen/getCity",{"id":"120100","type":"3"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getMyCar(){
	  $.post("<%=path%>/appUser/shop/getMyCar",{"userid":userid,"datakey":datakey,"UUID":UUID},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function addCar(){
	  $.post("<%=path%>/appUser/shop/addCar",{"userid":userid,"datakey":datakey,"UUID":UUID,"id":"1","stockid":"2","num":"1"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function upCar(){
	  $.post("<%=path%>/appUser/shop/upCar",{"userid":userid,"datakey":datakey,"UUID":UUID,"id":"20210801084935221438","num":"2"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function delCar(){
	  $.post("<%=path%>/appUser/shop/delCar",{"userid":userid,"datakey":datakey,"UUID":UUID,"id":"20210801084935221438"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getPostFee(){
	  $.post("<%=path%>/appUser/shop/getPostFee",{"userid":userid,"datakey":datakey,"UUID":UUID,"goodsid":"20210801084935221438","addrid":"1","num":"1"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  function buyGoods(){
	  $.post("<%=path%>/appUser/shop/buyGoods",{"userid":userid,"datakey":datakey,"UUID":UUID,"goodsId":"2","stockid":"20211210091734206827","num":"2","addrid":"20210803161617301322"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function buyCarGoods(){
	  $.post("<%=path%>/appUser/shop/buyCarGoods",{"userid":userid,"datakey":datakey,"UUID":UUID,"ids":"20210927204111717635","addrid":"20210803161617301322"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getPayMsg(){
	  $.post("<%=path%>/appUser/shop/getPayMsg",{"userid":userid,"datakey":datakey,"UUID":UUID,"listid":"20210927205512662637","type":"3"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  
  function myAddr(){
	  $.post("<%=path%>/appUser/userCenter/myAddr",{"userid":userid,"datakey":datakey,"UUID":UUID},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function addAddr(){
	  $.post("<%=path%>/appUser/userCenter/addAddr",{"userid":userid,"datakey":datakey,"UUID":UUID,"province":"黑龙江省","city":"哈尔滨市"
		  ,"area":"香坊区","addr":"长安街号","phone":"13366666666","name":"老李"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function editAddr(){
	  $.post("<%=path%>/appUser/userCenter/editAddr",{"userid":userid,"datakey":datakey,"UUID":UUID,"province":"黑龙江省","city":"哈尔滨市"
		  ,"area":"香坊区","addr":"进香街五位六祖112号","phone":"13388888888","name":"老四","id":"20210803161617301322"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function delAddr(){
	  $.post("<%=path%>/appUser/userCenter/delAddr",{"userid":userid,"datakey":datakey,"UUID":UUID,"id":"20210803161617301322"},function(data){
		  
		  $("#res").html(data);
	  })
  }      
  function setDefaultAddr(){
	  $.post("<%=path%>/appUser/userCenter/setDefaultAddr",{"userid":userid,"datakey":datakey,"UUID":UUID,"id":"20210803161617301322"},function(data){
		  
		  $("#res").html(data);
	  })
  }   
  function getDefaultAddr(){
	  $.post("<%=path%>/appUser/userCenter/getDefaultAddr",{"userid":userid,"datakey":datakey,"UUID":UUID},function(data){
		  
		  $("#res").html(data);
	  })
  }   
  
  function myList(){
	  $.post("<%=path%>/appUser/userCenter/myList",{"userid":userid,"datakey":datakey,"UUID":UUID,"status":"1"},function(data){
		  
		  $("#res").html(data);
	  })
  }  
  function myListDetail(){
	  $.post("<%=path%>/appUser/userCenter/myListDetail",{"userid":userid,"datakey":datakey,"UUID":UUID,"id":"20210806140459788346"},function(data){
		  
		  $("#res").html(data);
	  })
  }  
  function cancelList(){
	  $.post("<%=path%>/appUser/userCenter/cancelList",{"userid":userid,"datakey":datakey,"UUID":UUID,"id":"20210806140459788346"},function(data){
		  
		  $("#res").html(data);
	  })
  } 
  
  function myMember(){
	  window.open("<%=path%>/appUser/userCenter/myMember?userid="+userid+"&datakey="+datakey+"&UUID="+UUID+"");
	  $.post("<%=path%>/appUser/userCenter/myListDetail",{"userid":userid,"datakey":datakey,"UUID":UUID},function(data){
		  
		  $("#res").html(data);
	  })
  }  
  function amountLog(){
	  window.open("<%=path%>/appUser/userCenter/amountLog?userid="+userid+"&datakey="+datakey+"&UUID="+UUID+"");

  }
  function myCodePage(){
	  window.open("<%=path%>/appUser/userCenter/myCodePage?userid="+userid+"&datakey="+datakey+"&UUID="+UUID+"");

  }
  function testPayBack(){
	  $.post("<%=path%>/pay/testPayBack",{"id":listid},function(data){
		  
		  $("#res").html(data);
	  })
  }  
  function transferAmount(){
	  $.post("<%=path%>/appUser/userCenter/transferAmount",{"userid":userid,"datakey":datakey,"UUID":UUID,"reciveId":"2","amount":"10","pwd":"888888"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function cashOut(){
	  $.post("<%=path%>/appUser/userCenter/cashOut",{"userid":userid,"datakey":datakey,"UUID":UUID,"bank":"中国建设银行","amount":"10"
	  ,"cardCode":"333322221111","username":"老马"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  function payOffLine(){
	  $.post("<%=path%>/appUser/userCenter/payOffLine",{"userid":userid,"datakey":datakey,"UUID":UUID,"listid":"111","pwd":"888888","type":"3"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function getUserByCP(){
	  $.post("<%=path%>/appUser/userCenter/getUserByCP",{"userid":userid,"datakey":datakey,"UUID":UUID,"serchStr":"13349307202"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function changePWD(){
	  $.post("<%=path%>/appUser/userCenter/changePWD",{"userid":userid,"datakey":datakey,"UUID":UUID,"oldPwd":"888888","newPwd":"321"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function editUser(){
	  $.post("<%=path%>/appUser/userCenter/editUser",{"userid":userid,"datakey":datakey,"UUID":UUID,"realName":"老马啊","head":"www.head.jpg"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function testMonthAmount(){
	  $.post("<%=path%>/appUser/userCenter/testMonthAmount",{"userid":userid,"datakey":datakey,"UUID":UUID},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function applyArea(){
	  $.post("<%=path%>/appUser/userCenter/applyArea",{"userid":userid,"datakey":datakey,"UUID":UUID,"province":"黑龙江省","city":"哈尔滨市"
		  ,"area":"香坊区"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function selArea(){
	  $.post("<%=path%>/appUser/userCenter/selArea",{"userid":userid,"datakey":datakey,"UUID":UUID,"province":"黑龙江省","city":"哈尔滨市"
		  ,"area":"香坊区"},function(data){
		  
		  $("#res").html(data);
	  })
  }
  function shopRequest(){
	  $.post("<%=path%>/appUser/userCenter/shopRequest",{"userid":userid,"datakey":datakey,"UUID":UUID},function(data){
		  
		  $("#res").html(data);
	  })
  }
  
  </script>
  
  </body>
</html>
